/*
 * @Author: maoyu
 * @Date: 2021-05-25 10:24:53
 * @LastEditTime: 2021-07-01 11:16:55
 * @LastEditors: zzp
 * @Description: 电子校务-工作流-接口
 */

import request from '@/utils/request'

const PRE_CODE = '/affairsWorkflow'
const APPLY_PRE_CODE = '/affairsApplyWorkflow'

// 流程配置
export function getTableListWorkflow(params) {
  return request({
    url: `${PRE_CODE}/getTableList`,
    method: 'get',
    params
  })
}

// 流程配置查看
export function getWorkflowInfo(params) {
  return request({
    url: `${PRE_CODE}/info`,
    method: 'get',
    params
  })
}

// 新增流程
export function saveWorkflow(data) {
  return request({
    url: `${PRE_CODE}/save`,
    method: 'post',
    data
  })
}
// 删除流程
export function deleteWorkflow(data) {
  return request({
    url: `${PRE_CODE}/delete`,
    method: 'post',
    data
  })
}

// 流程配置
export function getListWorkflow(params) {
  return request({
    url: `${PRE_CODE}/getList`,
    method: 'get',
    params
  })
}

// 申请列表
export function getTableListWorkflowApply(params) {
  return request({
    url: `${APPLY_PRE_CODE}/getApplyList`,
    method: 'get',
    params
  })
}

// 申请查看
export function getWorkflowApplyInfo(params) {
  return request({
    url: `${APPLY_PRE_CODE}/info`,
    method: 'get',
    params
  })
}

// 新增申请
export function applyWorkflowApply(data) {
  return request({
    url: `${APPLY_PRE_CODE}/apply`,
    method: 'post',
    data
  })
}
// 删除申请
export function cancelWorkflowApply(params) {
  return request({
    url: `${APPLY_PRE_CODE}/cancel`,
    method: 'get',
    params
  })
}
// 审批列表
export function getExamineListWorkflow(params) {
  return request({
    url: `${APPLY_PRE_CODE}/getExamineList`,
    method: 'get',
    params
  })
}

// 审批
export function examineWorkflow(data) {
  return request({
    url: `${APPLY_PRE_CODE}/examine`,
    method: 'post',
    data
  })
}
